package com.ror.java.se.thread;

//public void join() 插入线程/插队线程
//把调用它的线程插队到当前线程（运行它的线程）之前运行

public class Demo06 {
    public static void main(String[] args) throws InterruptedException {
        MyRun mr = new MyRun();
        Thread t1 = new Thread(mr, "飞机");
        t1.start();
        t1.join();

        for (int i = 0; i < 50; i++) {
            System.out.println(Thread.currentThread().getName() + ": " + i);
        }
    }

    private static class MyRun implements Runnable {
        @Override
        public void run() {
            for (int i = 0; i < 50; i++) {
                System.out.println(Thread.currentThread().getName() + ": " + i);
            }
        }
    }
}
